//package com.fingard.dsp.bank.directbank.citi01;
//
//
//import java.io.File;
//
//import com.fingard.dsp.bank.directConfig.TaskTimerSet;
//import com.fingard.dsp.bank.directbank.bankInterface.IScheduleTask;
//
//import static com.fingard.text.StringHelper.trimEndFileSp;
//
//public class CITI01ScheduleTask extends CITI01Base implements IScheduleTask {
//
//    public void  execTask(TaskTimerSet timerSet){
//        try{
//            if (timerSet.taskNameList.toLowerCase().contains("citidownload")){
//                String sftpFiles  = downloadFile();
//                //已接收的文件目录
//                String localAddress = getBankConfig().getValueAsString("ReceiveFilePath");
//                localAddress = trimEndFileSp(localAddress);
//                //获取已接收未处理的文件
//                String[] receiveFileList = new File(localAddress).list();
//                //处理未解密的文件
//                if(receiveFileList!=null&&receiveFileList.length!=0) {
//                    for (String fileName : receiveFileList) {
//                        WriteBankLogLn("开始解密文件"+fileName);
//                        System.out.println("开始解密文件：" + fileName);
//                        decryptFile(fileName);
//                    }
//                }
//                //已解密的文件目录
//                String decryptPath = getBankConfig().getValueAsString("DecryptPath");
//                decryptPath = trimEndFileSp(decryptPath);
//                //获取已接收未处理的文件
//                String[] receiveFileList2 = new File(decryptPath).list();
//                //处理已解密待解析的文件
//                if(receiveFileList2!=null&&receiveFileList2.length!=0) {
//                    //将MT940文件先解析
//                    StringBuilder sb=new StringBuilder();
//                    for (String fileName : receiveFileList2) {
//                        if(fileName.toUpperCase().contains("MT940")){
//                            sb.insert(0,fileName+",");
//                        }else {
//                            sb.append(fileName+",");
//                        }
//                    }
//                    String[] receiveFileList3=sb.toString().substring(0,sb.toString().length()-1).split(",");
//                    for (String fileName : receiveFileList3) {
//                        handleNewFile(fileName);
//                    }
//                }
//            }
//        }catch (Exception ex){
//            WriteBankLogLn("文件解析异常："+ex);
//        }
//    }
//}
